package com.jiexin.service.impl;

import com.jiexin.dao.cat.CATChangeMapper;
import com.jiexin.dao.dsh.DSHChangeMapper;
import com.jiexin.model.ErrorSyncChange;
import com.jiexin.service.ChangeTabService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author:
 * @Description: change service
 * @Date:
 * @Modified By:
 */
@Slf4j
@Service
public class ChangeTabServiceImpl implements ChangeTabService {

    @Resource
    DSHChangeMapper dshChangeMapper;

    @Resource
    CATChangeMapper catChangeMapper;

    @Override
    public Integer findDSHNotTransferredChange() {
        return dshChangeMapper.findNotTransferredChange();
    }

    @Override
    public Integer findCATNotTransferredChange() {
        return catChangeMapper.findNotTransferredChange();
    }

    @Override
    public ErrorSyncChange dshDetectErrorSyncChange() {
        return dshChangeMapper.detectErrorSyncChange();
    }

    @Override
    public ErrorSyncChange catDetectErrorSyncChange() {
        return catChangeMapper.detectErrorSyncChange();
    }

    @Override
    public void updateDSHSyncMsgForChange(Integer pid, Integer state, String message) {
        dshChangeMapper.updateSyncMsgForChange(pid, state, message);
    }

    @Override
    public void updateCATSyncMsgForChange(Integer pid, Integer state, String message) {
        catChangeMapper.updateSyncMsgForChange(pid, state, message);
    }

    @Override
    public void updateDSHMailStateForChange(Integer pid, Integer mailState) {
        dshChangeMapper.updateMailState(pid, mailState);
    }

    @Override
    public void updateCATMailStateForChange(Integer pid, Integer mailState) {
        catChangeMapper.updateMailState(pid, mailState);
    }


}
